<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="primus" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" tagdir="/WEB-INF/tags/form" %>
<primus:page title="人工分单列表">
    <jsp:attribute name="css">
        <style type="text/css">
            #table .operate {
                min-width: 80px;
            }
        </style>
    </jsp:attribute>
    <jsp:attribute name="script">
        <script type="application/javascript">
            $(function () {
                $("#table").DataTable({
                    "lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "所有"]],
                    "columnDefs": [{"targets": [7], "orderable": false}],
                    "searching": false,
                    "order": [[0, "asc"]]
                });
            });
            $("body").on("click", ".geo-line", function () {
                var id = $(this).data("id");
            })
        </script>
    </jsp:attribute>
    <jsp:body>
        <div class="breadcrumbs ace-save-state" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="welcome.do">
                        首页
                    </a>
                </li>
                <li>
                    <a href="geo/provinces">
                        订单管理
                    </a>
                </li>
                <li class="active">
                    人工分单列表
                </li>
            </ul>
        </div>

        <div class="page-content">

            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                        <div class="col-xs-12">
                            <h3 class="header smaller lighter blue">
                                人工分单详情
                            </h3>
                            <div class="row">
                                <div class="tabbable" style="float:right">
                                    <button class="btn btn-white btn-default btn-round" id="dispatchButton">
                                        <i class="ace-icon fa fa-share blue" style="padding:0;margin:0;float:left;box-sizing:border-box;"></i>
                                        改派
                                    </button>

                                    <button class="btn btn-white btn-default btn-round" id="closeButton">
                                        <i class="ace-icon fa fa-times red2" style="padding:0;margin:0;float:left;box-sizing:border-box;"></i>
                                        关闭
                                    </button>
                                </div>
                                <div class="tabbable" style="width: 100%; height: 100%; display: inline-table;">

                                    <ul class="nav nav-tabs padding-12 tab-color-blue background-blue" id="myTab4">
                                        <li class="">
                                            <a id="li1" data-toggle="tab" href="#ord_bas_inf" aria-expanded="false">订单基本信息</a>
                                        </li>

                                        <li class="">
                                            <a data-toggle="tab" href="#pro_inf" aria-expanded="false">商品信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#pro_spl_inf" aria-expanded="true">商品拆分信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#pre_inf" aria-expanded="true">优惠信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#pay_inf" aria-expanded="true">支付信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#con_inf" aria-expanded="true">收货人信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#mem_inf" aria-expanded="true">会员信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#ret_inf" aria-expanded="true">出库信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#ref_inf" aria-expanded="true">退货信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#rei_inf" aria-expanded="true">退款信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#dis_inf" aria-expanded="true">配送信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#ord_tra_pay_inf" aria-expanded="true">订单转支付信息</a>
                                        </li>

                                        <li class="active">
                                            <a data-toggle="tab" href="#act_inf" aria-expanded="true">操作记录</a>
                                        </li>
                                    </ul>

                                    <div class="tab-content">
                                        <div id="ord_bas_inf" class="tab-pane">
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >订单来源</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >商品总金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >会员帐号</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >订单编号</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >商品优惠金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >会员姓名</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >下单时间</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >订单优惠金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >会员手机号</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >配送优先级</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >平台优惠金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >会员等级</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >配送门店</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >配送费用</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >收货人姓名</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_name" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >门店名称</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >订单总金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >收货人电话</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_tel" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >配送方式</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >已支付金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >收货人地址</label>
                                                    <textarea rows="3" cols="33" style="resize: none;" class="con_inf_address"></textarea>
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >要求送达时间</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >下单人</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >进入中台时间</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >下单人工号</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >用户备注</label>
                                                    <textarea rows="3" cols="170" style="resize: none;"></textarea>
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >卖家备注</label>
                                                    <textarea rows="3" cols="170" style="resize: none;"></textarea>
                                                </div>
                                            </div>
                                        </div>

                                            <%--商品信息--%>
                                        <div id="pro_inf" class="tab-pane">
                                            <table id="table_pro_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>商品编号</th>
                                                        <th>商品名称</th>
                                                        <th>商品数量</th>
                                                        <th>商品总价</th>
                                                        <th>市场价</th>
                                                        <th>购买价</th>
                                                        <th>商品类型</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                            <%--商品拆分信息--%>
                                        <div id="pro_spl_inf" class="tab-pane">
                                            <table id="table_pro_spl_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>组合商品编号</th>
                                                        <th>商品编号</th>
                                                        <th>商品数量</th>
                                                        <th>市场价</th>
                                                        <th>购买价</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                            <%--商品优惠信息--%>
                                        <div id="pre_inf" class="tab-pane">
                                            <table id="table_pre_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>优惠ID</th>
                                                        <th>优惠信息名称</th>
                                                        <th>优惠活动描述</th>
                                                        <th>优惠金额</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                        <div id="pay_inf" class="tab-pane">
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >付款方式</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >支付状态</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >支付方式</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >已付金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >应收总额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >未付金额</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >支付单号</label>
                                                    <input type="text" class="col-xs-8 col-sm-8" />
                                                </div>
                                            </div>
                                        </div>

                                        <div id="con_inf" class="tab-pane">
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >收货人姓名</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_name" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >手机号</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_tel" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >邮箱</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_email" />
                                                </div>
                                            </div>
                                            <br>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >省</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_province"  />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >市</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_city" />
                                                </div>
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >县/区</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_area" />
                                                </div>
                                            </div>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-6 control-label no-padding-right" >详细地址</label>
                                                    <textarea rows="3" cols="170" style="resize: none;" class="con_inf_address"></textarea>
                                                </div>
                                            </div>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >经度</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_lon" />
                                                </div>
                                            </div>
                                            <br>
                                            <div class="row">
                                                <div class="col-sm-4">
                                                    <label class="col-sm-4 control-label no-padding-right" >纬度</label>
                                                    <input type="text" class="col-xs-8 col-sm-8 con_inf_dim"  />
                                                </div>
                                            </div>
                                        </div>

                                        <div id="mem_inf" class="tab-pane">
                                            <table id="table_mem_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                <tr>
                                                    <th>会员帐号</th>
                                                    <th>会员电话</th>
                                                    <th>会员姓名</th>
                                                    <th>会员级别</th>
                                                </tr>
                                                </thead>
                                            </table>
                                        </div>

                                        <div id="ret_inf" class="tab-pane">
                                            <table id="table_ret_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>出库状态</th>
                                                        <th>发货数量</th>
                                                        <th>修改时间</th>
                                                        <th>操作人</th>
                                                        <th>是否更改</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                        <div id="ref_inf" class="tab-pane">
                                            <table id="table_ref_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>退货单号</th>
                                                        <th>商品编号</th>
                                                        <th>商品名称</th>
                                                        <th>商品数量</th>
                                                        <th>商品价格</th>
                                                        <th>操作人</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                        <div id="rei_inf" class="tab-pane">
                                            <table id="table_rei_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>退款单号</th>
                                                        <th>退货单号</th>
                                                        <th>退款金额</th>
                                                        <th>退款方式</th>
                                                        <th>退款单状态</th>
                                                        <th>退款单创建时间</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                        <div id="dis_inf" class="tab-pane">
                                            <table id="table_dis_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>配送单号</th>
                                                        <th>配送状态</th>
                                                        <th>配送公司</th>
                                                        <th>门店编号</th>
                                                        <th>门店名称</th>
                                                        <th>配送员工号</th>
                                                        <th>配送员姓名</th>
                                                        <th>备注</th>
                                                        <th>更新时间</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                        <div id="ord_tra_pay_inf" class="tab-pane">
                                            <table id="table_ord_tra_pay_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>支付方式</th>
                                                        <th>支付金额</th>
                                                        <th>支付单号</th>
                                                        <th>支付时间</th>
                                                        <th>操作人</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                        <div id="act_inf" class="tab-pane">
                                            <table id="table_act_inf" class="table table-hover" style="width: 100%;">
                                                <thead>
                                                    <tr>
                                                        <th>操作记录</th>
                                                        <th>操作备注</th>
                                                        <th>操作人</th>
                                                        <th>操作时间</th>
                                                    </tr>
                                                </thead>
                                            </table>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </div>

        <script>
            $(function(){

                $("#li1").click();
                var vc = sessionStorage.getItem('sendOperation'); // => 返回testKey对应的值
                var row1 = JSON.parse(vc)

                GetRequest(row1);

                $("#table_pro_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
                    data:row1.items
                });
                $("#table_pro_spl_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pro_spl_inf
                });
                $("#table_pre_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });
                $("#table_mem_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });
                $("#table_ret_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });
                $("#table_ref_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });
                $("#table_rei_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });
                $("#table_dis_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });
                $("#table_ord_tra_pay_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });
                $("#table_act_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
//                    data:row1.pre_inf
                });

            });

            // 改派按钮(跳转改派页面)
            $("#dispatchButton").on("click", function () {
                window.location.href="/manualSingle/manualSingleReassignment";
            });

            // 关闭按钮(跳转回派单列表页面)
            $("#closeButton").on("click", function () {
                window.location.href="/manualSingle.do";
            });

            // 获取session 存储的值
            function GetRequest(row) {
                console.log(JSON.stringify(row));

                con_inf_value(row.consignee);    //收货人信息赋值
            }

            // 收货人信息赋值
            function con_inf_value(consignee) {
                if (consignee != null) {
                    $(".con_inf_name").val(consignee.consigneeName);
                    $(".con_inf_tel").val(consignee.consigneeMobile);
//                    $(".con_inf_email").val(consignee.consigneeMobile); //暂缺
                    $(".con_inf_province").val(consignee.provinceId);
                    $(".con_inf_city").val(consignee.cityId);
                    $(".con_inf_area").val(consignee.districtId);
                    $(".con_inf_address").val(consignee.address);
                    $(".con_inf_lon").val(consignee.lat);
                    $(".con_inf_dim").val(consignee.lon);
                }
            }

        </script>
    </jsp:body>
</primus:page>